import request from '@/utils/request'

export function getEntList(data) {//企业列表
  return request({
    url: '/ent/list',
    method: 'get',
    params:data
  })
}

export function getIndustryList() {
  return request({
    url: '/industry/list',
    method: 'get'
  })
}
export function getServiceList() {
  return request({
    url: '/common/client/list',
    method: 'get'
  })
}
export function getServerList(data) {
  return request({
    url: '/enterprise/sever/get?entNum='+data,
    method: 'get'
  })
}
export function saveEnt(data) { //保存企业
  return request({
    url: '/ent/add',
    method: 'post',
    data
  })
}

export function getVideoRatioList() { // 获取视频宽高比列表
  return request({
    url: "/meeting/video/getVideoRatioList",
    method: 'get'
  })
}
export function getAreaList(data) { //省
  return request({
    url: '/city/list?parentId=' + data,
    method: 'get'
  })
}

export function getEntInfo(id) {
  return request({
    url: `/ent/get/${id}`,
    method: 'get'
  })
}
export function changeEntInfo(data) {
  return request({
    url: "/ent/update",
    method: 'post',
    data
  })
}
export function cancelEnt(entNum,enable) {
  return request({
    url: "/ent/disable?entNum="+entNum+"&enable="+enable,
    method:"get",
  })
}
export function recover(data) { // 注销恢复
  return request({
    url: '/enterprise/usability',
    method: 'post',
    data
  })
}

export function del(id) { // 删除
  return request({
    url: `/enterprise/delete/${id}`,
    method: 'get'
  })
}
export function getEntServiceDetail(data) { // 获取服务列表
  return request({
    url: `/enterprise/sever/detail?entNum=`+data,
    method: 'post'
  })
}
export function getClientList() { // 获取服务列表
  return request({
    url: `common/client/list`,
    method: 'get'
  })
}

export function getOperateList() { // 获取运营点列表
  return request({
    url: `/system/dop/enterprise/operate`,
    method: 'get'
  })
}

export function getbillEntList() { // 获取企业关系列表
  return request({
    url: `/system/dop/enterprise/getBillEntInfo`,
    method: 'get'
  })
}
export function getChargeEntList() { // 获取计费企业列表
  return request({
    url: `/system/dop/enterprise/getChargeEntInfo`,
    method: 'get'
  })
}

export function getDefaultUsersInfo(data) { // 获取企业账号信息
  return request({
    url: `/enterprise/getDefaultUsersInfo`,
    method: 'post',
    data
  })
}

export function serviceEnd(data) { // 下线服务
  return request({
    url: `/enterprise/sever/offline`,
    method: 'post',
    data
  })
}

export function subscript(data) { // 订阅服务
  return request({
    url: `/enterprise/sever/subscribe`,
    method: 'post',
    data
  })
}

export function fetchsmsChannel(data) { // 短信渠道
  return request({
    url: "/agent/udt/sms/channel/get",
    method: 'post',
    data
  })



}

// 更新配置项
export function fetchConfig(data) {
  return request({
    url: '/ent/config/update',
    method: 'post',
    data
  })
}
//配置项获取
export function fetchConfigData(data) {
  return request({
    url: '/ent/config/get',
    method: 'get',
    params:data
  })
}
//配置项下拉列表获取
export function fetchConfigList(data) {
  return request({
    url: '/ent/config/enums',
    method: 'post',
    data
  })
}